/* 视频抽屉样式 */
.video-drawer-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  z-index: 999;
  animation: fadeIn 0.2s ease-out;
}

.video-drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: 420px;
  height: 100vh;
  background: #1a1a1a;
  border-left: 1px solid #333;
  box-shadow: -4px 0 20px rgba(0, 0, 0, 0.3);
  z-index: 1000;
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
}

.video-drawer.open {
  transform: translateX(0);
}

/* 抽屉头部 */
.drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid #333;
  background: #222;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.drawer-header h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  color: #fff;
}

.video-count {
  font-size: 12px;
  color: #999;
  background: rgba(255, 255, 255, 0.1);
  padding: 2px 8px;
  border-radius: 12px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.refresh-btn,
.close-btn {
  width: 32px;
  height: 32px;
  border: none;
  background: rgba(255, 255, 255, 0.1);
  color: #ccc;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  transition: all 0.2s ease;
}

.refresh-btn:hover,
.close-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
}

/* 当前播放视频 */
.current-playing {
  padding: 16px 24px;
  background: rgba(0, 161, 214, 0.1);
  border-bottom: 1px solid rgba(0, 161, 214, 0.2);
}

.current-label {
  font-size: 12px;
  color: #00a1d6;
  font-weight: 500;
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.current-video-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.current-video-info .video-thumbnail {
  width: 60px;
  height: 40px;
  border-radius: 6px;
  overflow: hidden;
  background: #333;
  display: flex;
  align-items: center;
  justify-content: center;
}

.current-video-info .video-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.current-video-info .thumbnail-placeholder {
  font-size: 20px;
  color: #666;
}

.current-video-info .video-details {
  flex: 1;
}

.current-video-info .video-name {
  font-size: 14px;
  font-weight: 500;
  color: #fff;
  margin-bottom: 4px;
  line-height: 1.2;
}

.current-video-info .video-meta {
  display: flex;
  gap: 8px;
  font-size: 12px;
  color: #999;
}

.current-video-info .video-meta span {
  background: rgba(255, 255, 255, 0.1);
  padding: 2px 6px;
  border-radius: 4px;
}

/* 抽屉内容 */
.drawer-content {
  flex: 1;
  overflow-y: auto;
  padding: 0 24px 24px;
}

.video-section {
  margin-top: 24px;
}

.video-section:first-child {
  margin-top: 20px;
}

.video-section h4 {
  margin: 0 0 16px 0;
  font-size: 14px;
  font-weight: 600;
  color: #ccc;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* 视频网格 */
.video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
}

.video-card {
  background: #2a2a2a;
  border: 1px solid #333;
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
}

.video-card:hover {
  border-color: #555;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.video-card.active {
  border-color: #00a1d6;
  background: rgba(0, 161, 214, 0.1);
}

.video-card .video-thumbnail {
  width: 100%;
  height: 90px;
  background: #333;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.video-card .video-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.video-card .thumbnail-placeholder {
  font-size: 24px;
  color: #666;
}

.playing-indicator {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 32px;
  height: 32px;
  background: rgba(0, 161, 214, 0.9);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 12px;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

.video-card .video-info {
  padding: 12px;
}

.video-card .video-name {
  font-size: 13px;
  font-weight: 500;
  color: #fff;
  margin-bottom: 6px;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.video-card .video-meta {
  display: flex;
  gap: 6px;
  font-size: 11px;
  color: #999;
}

.video-card .video-meta span {
  background: rgba(255, 255, 255, 0.1);
  padding: 2px 6px;
  border-radius: 4px;
}

/* 上传区域 */
.upload-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px 20px;
  border: 2px dashed #555;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  background: #2a2a2a;
  text-align: center;
}

.upload-area:hover {
  border-color: #00a1d6;
  background: rgba(0, 161, 214, 0.05);
}

.upload-area.drag-over {
  border-color: #00a1d6;
  background: rgba(0, 161, 214, 0.1);
}

.upload-icon {
  font-size: 36px;
  margin-bottom: 16px;
  color: #666;
}

.upload-text {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.primary-text {
  font-size: 14px;
  font-weight: 500;
  color: #fff;
}

.secondary-text {
  font-size: 12px;
  color: #999;
}

.format-text {
  font-size: 11px;
  color: #777;
  margin-top: 4px;
}

/* 空状态 */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  text-align: center;
}

.empty-icon {
  font-size: 48px;
  margin-bottom: 16px;
  color: #555;
}

.empty-text {
  color: #999;
}

.empty-text > div:first-child {
  font-size: 16px;
  font-weight: 500;
  margin-bottom: 8px;
  color: #ccc;
}

.empty-text > div:last-child {
  font-size: 14px;
}

/* 滚动条样式 */
.drawer-content::-webkit-scrollbar {
  width: 6px;
}

.drawer-content::-webkit-scrollbar-track {
  background: #2a2a2a;
  border-radius: 3px;
}

.drawer-content::-webkit-scrollbar-thumb {
  background: #555;
  border-radius: 3px;
}

.drawer-content::-webkit-scrollbar-thumb:hover {
  background: #666;
}

/* 动画 */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* 响应式设计 */
@media (max-width: 768px) {
  .video-drawer {
    width: 100vw;
    left: 0;
    right: 0;
  }
  
  .video-grid {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 10px;
  }
  
  .drawer-header {
    padding: 16px 20px;
  }
  
  .drawer-content {
    padding: 0 20px 20px;
  }
}
